<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
<script>
// 放 带花色的牌 11=J 12=Q 13=K 14=A 15=2  16小王17大王
let pai = [];
let a=[],b=[],c=[];
let k = ['黑','红','梅','方'];
//对象
for(let i = 3;i<=15;i++){
    for(let j=0;j<4;j++){
        pai.push( { color: k[j],  num: i });
    }   
}
pai.push({ color: '小王',  num: 16 });
pai.push({ color: '大王',  num: 17 });

//洗牌
pai.sort(()=> 0.5 - Math.random());

//发牌  
for(let i=1; i<=17; i++){
    a.push( pai.pop() ); //删除一张
    b.push( pai.pop() );
    c.push( pai.pop() );
}
//排序
a.sort((a,b)=>{return a.num - b.num });
b.sort((a,b)=>{return a.num - b.num });
c.sort((a,b)=>{return a.num - b.num });

console.log( pai );
console.log( a );
console.log( b );
console.log( c );





</script>

    
</body>
</html>